package com.ljf.code.api.service.impl;

import com.ljf.code.domain.service.TextConversionDomainService;
import com.ljf.code.domain.validator.TextConversionValidator;
import com.ljf.code.dto.other.TextConversionTranslation;
import com.ljf.code.service.ITextConversionService;
import com.ljf.code.vo.TextConversionVO;
import com.ljf.common.api.service.impl.NoDBBasisServiceImpl;
import com.ljf.common.exception.ServiceException;
import com.ljf.common.result.ServiceResultModel;
import com.ljf.common.utils.ServiceResultUtil;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 文本转换  服务接口实现
 *
 * @author LJF
 * @since 2024-06-18
 */
@Service
public class TextConversionServiceImpl extends NoDBBasisServiceImpl<TextConversionDomainService, TextConversionValidator> implements ITextConversionService {

    /**
     * 转化接口
     *
     * @param model
     * @return
     * @throws ServiceException
     */
    @Override
    public ServiceResultModel<TextConversionVO> translation(TextConversionTranslation model) throws ServiceException {
        validator.checkTranslation(model);
        List<TextConversionVO> resultList = domainService.translation(model);
        return ServiceResultUtil.success(resultList);
    }

}
